package com.xbongbong.saas.script.tempenum;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.paas.enums.DateTimeEnum;
import com.xbongbong.paas.help.FormDataFormExplainHelper;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.field.ItemPoJo;
import com.xbongbong.paas.field.LinkDetailPojo;
import com.xbongbong.pro.constant.I18nStringConstant;
import com.xbongbong.pro.enums.AmountFlagEnum;
import com.xbongbong.pro.enums.SaasMarkEnum;
import com.xbongbong.paas.field.SaasParticularAttributePoJo;
import com.xbongbong.saas.constant.BasicConstant;
import com.xbongbong.saas.constant.StringConstant;
import com.xbongbong.saas.enums.ForbiddenSettingEnum;
import com.xbongbong.saas.enums.PaymentLinkTypeEnum;
import com.xbongbong.saas.enums.RedundantTemplateTypeEnum;
import com.xbongbong.saas.enums.ShowTypeEnum;
import com.xbongbong.saas.enums.XbbRefTypeEnum;
import com.xbongbong.saas.enums.business.PaymentEnum;
import com.xbongbong.saas.enums.dictionary.HasRedEnum;
import com.xbongbong.saas.enums.dictionary.IsRedEnum;
import com.xbongbong.saas.enums.dictionary.PayMethodEnum;
import com.xbongbong.saas.enums.dictionary.PaymentStatusEnum;
import com.xbongbong.saas.enums.dictionary.PaymentTypeEnum;
import com.xbongbong.saas.script.help.InitExplainsHelper;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

import com.xbongbong.sys.enums.RoleEnum;
import lombok.Getter;

/**
 * @author feng.zheng
 * @version v1.0
 * @date 2019/1/14 16:26
 * @since v1.0
 */
@Getter
public enum TempPaymentEnum {
    //刷脚本专用枚举

    BASE_INFO(PaymentEnum.BASE_INFO),
    PAYMENT_NO(PaymentEnum.PAYMENT_NO),
    AMOUNT(PaymentEnum.AMOUNT),
    REAL_AMOUNT(PaymentEnum.REAL_AMOUNT),
    UN_AMOUNT(PaymentEnum.UN_AMOUNT),
    BAD_AMOUNT(PaymentEnum.BAD_AMOUNT),
    RED_AMOUNT(PaymentEnum.RED_AMOUNT),
    STATUS(PaymentEnum.STATUS),
    GENERATION_DATE(PaymentEnum.GENERATION_DATE),
    RECEIVABLE_PERIOD(PaymentEnum.RECEIVABLE_PERIOD),
    ESTIMATE_TIME(PaymentEnum.ESTIMATE_TIME),

    CUSTOMER(PaymentEnum.CUSTOMER),
    CONTRACT(PaymentEnum.CONTRACT),
    SOURCE(PaymentEnum.SOURCE),
    BELONGER(PaymentEnum.BELONGER),
    PAYMENT_METHOD(PaymentEnum.PAYMENT_METHOD),
    PAYMENT_TYPE(PaymentEnum.PAYMENT_TYPE),
    INVOICE_AMOUNT(PaymentEnum.INVOICE_AMOUNT),
    MEMO(PaymentEnum.MEMO),

    SYSTEM_INFO(PaymentEnum.SYSTEM_INFO),
    CREATOR_ID(PaymentEnum.CREATOR_ID),
    ADD_TIME(PaymentEnum.ADD_TIME),
    UPDATE_TIME(PaymentEnum.UPDATE_TIME),

    ADD_PAYMENT(PaymentEnum.ADD_PAYMENT),
    OWNER_ID(PaymentEnum.OWNER_ID),
    COUSERID(PaymentEnum.COUSERID),
    REAL_PAY_TIME(PaymentEnum.REAL_PAY_TIME),
    IS_RED(PaymentEnum.IS_RED),
    HAS_RED(PaymentEnum.HAS_RED),
    RECEIVABLE_IS_RED(PaymentEnum.RECEIVABLE_IS_RED),
    RECEIVABLE_HAS_RED(PaymentEnum.RECEIVABLE_HAS_RED),
    REF_TYPE(PaymentEnum.REF_TYPE),
    SOURCE_REF_TYPE(PaymentEnum.SOURCE_REF_TYPE),
    ORIGIN_ID(PaymentEnum.ORIGIN_ID),
    RECEIVABLES_ORIGIN_ID(PaymentEnum.RECEIVABLES_ORIGIN_ID),
    CUSTOMER_LINK_TEXT(PaymentEnum.CUSTOMER_LINK_TEXT),
    CONTRACT_LINK_TEXT(PaymentEnum.CONTRACT_LINK_TEXT),
    UNIT(PaymentEnum.UNIT),
    RECEIVABLES_ORIGIN_LINK_TEXT(PaymentEnum.RECEIVABLES_ORIGIN_LINK_TEXT),
    SOURCE_LINK_TEXT(PaymentEnum.SOURCE_LINK_TEXT)
    ;

    private PaymentEnum anEnum;

    TempPaymentEnum(PaymentEnum anEnum) {
        this.anEnum = anEnum;
    }

    public static List<TempPaymentEnum> getAllEnum() {
        List<TempPaymentEnum> list = new ArrayList<>();
        Collections.addAll(list, values());
        return list;
    }

    public static void initPaymentNo(FieldAttrEntity fieldAttrEntity){
        LinkDetailPojo linkDetailPojo = new LinkDetailPojo();
        linkDetailPojo.setBusinessType(XbbRefTypeEnum.PAYMENT.getCode());
        linkDetailPojo.setSubBuisenssType(XbbRefTypeEnum.PAY_PLAN.getCode());
        linkDetailPojo.setSaasMark(SaasMarkEnum.SAAS.getCode());
        linkDetailPojo.setAttr(PAYMENT_NO.getAnEnum().getAttr());
        fieldAttrEntity.setLinkDetail(linkDetailPojo);
        fieldAttrEntity.setNoRepeat(1);
        fieldAttrEntity.setSerialNumber(InitExplainsHelper.setSerialNumber(SerialNumberEnum.PAYMENT_NO));
        fieldAttrEntity.setIsForbidden(0);
    }

    public static void initAddPayment(FieldAttrEntity fieldAttrEntity) {
        SaasParticularAttributePoJo saasParticularAttributePoJo = new SaasParticularAttributePoJo();
        saasParticularAttributePoJo.setRelyAttr(CONTRACT.anEnum.getAttr());
        saasParticularAttributePoJo.setLinkBusinessType(XbbRefTypeEnum.PAYMENT.getCode());
        fieldAttrEntity.setSaasParticularAttributePoJo(saasParticularAttributePoJo);
        fieldAttrEntity.setEditable(BasicConstant.ONE);
        fieldAttrEntity.setShowEditable(BasicConstant.ONE);
        fieldAttrEntity.setEditForbidden(BasicConstant.ONE);
        fieldAttrEntity.setIsForbidden(BasicConstant.ZERO);
    }
    /**
     * 初始化回款状态,反射会调用
     *
     * @param fieldAttrEntity 字段解释实体--saas专用
     * @author feng.zheng
     * @date 2019/1/17
     */
    public static void initStatus(FieldAttrEntity fieldAttrEntity) {
        List<ItemPoJo> itemPoJos = new ArrayList<>();
        Boolean checked=false;
        for (PaymentStatusEnum paymentStatusEnum : PaymentStatusEnum.values()){
            if (Objects.equals(paymentStatusEnum.getCode(),PaymentStatusEnum.UNKNOWN.getCode())){
                continue;
            }
            
            ItemPoJo itemPoJo = new ItemPoJo();
            itemPoJo.setText(paymentStatusEnum.getAlias());
            itemPoJo.setValue(paymentStatusEnum.getCode());
            if (paymentStatusEnum == PaymentStatusEnum.UN_RECEIVABLES ) {
                //|| paymentStatusEnum == PaymentStatusEnum.RECEIVABLES) {
                itemPoJo.setShowType(ShowTypeEnum.ALL.getCode());
                checked=true;
            } else {
                itemPoJo.setShowType(ShowTypeEnum.EXCLUDE_NEW.getCode());
                checked=false;
            }
            itemPoJo.setChecked(checked);
            itemPoJos.add(itemPoJo);
//            if (Objects.equals(paymentStatusEnum.getCode(),PaymentStatusEnum.RECEIVABLES.getCode())){
//                List<String> fieldMap = new ArrayList<>();
//                fieldMap.add(BELONGER.anEnum.getAttr());
//                fieldMap.add(PAYMENT_METHOD.anEnum.getAttr());
//                itemPoJo.setFieldMap(fieldMap);
//            }
        }
//        itemPoJos.get(1).setChecked(true);
        fieldAttrEntity.setEditable(0);
        fieldAttrEntity.setEditableAdvanceEnable(0);
        List<String> settingList = Arrays.asList(ForbiddenSettingEnum.DISABLE_ADVANCE_ENABLE.getAlias());
        fieldAttrEntity.setForbiddenSettingList(settingList);
        fieldAttrEntity.setItemBanDefault(BasicConstant.ONE);
        fieldAttrEntity.setShowEditable(0);
        fieldAttrEntity.setItems(itemPoJos);
        fieldAttrEntity.setIsForbidden(0);
        fieldAttrEntity.setNoItemLink(1);
    }

    /**
     * 初始化支付方式
     *
     * @param fieldAttrEntity 字段解释实体--saas专用
     * @author long.rao
     * @date 2019-02-22 14:27
     */
    public static void initPaymentMethod(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setItems(InitExplainsHelper.setCombItemByEnum(PayMethodEnum.class, fieldAttrEntity.getFieldType()));
        fieldAttrEntity.setDictionaryFlag(1);
    }

    public static void initGenerationDate(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setDateType(DateTimeEnum.TIME.getType());
       /*
        DefaultAttrPoJo defaultAttrPoJo = new DefaultAttrPoJo();
        defaultAttrPoJo.setDefaultType("today");
        fieldAttrEntity.setDefaultAttr(defaultAttrPoJo);*/
        fieldAttrEntity.setMemo(I18nMessageUtil.getMessage(I18nStringConstant.GENERATION_TIME_MEMO));
        fieldAttrEntity.setEditable(BasicConstant.ZERO);
        fieldAttrEntity.setEditForbidden(BasicConstant.ZERO);
        fieldAttrEntity.setShowEditable(BasicConstant.ZERO);
        fieldAttrEntity.setIsForbidden(0);
        List<String> settingList = Arrays.asList(ForbiddenSettingEnum.DISABLE_DEFAULT.getAlias());
        fieldAttrEntity.setForbiddenSettingList(settingList);
        fieldAttrEntity.setUnableEditMemo(I18nMessageUtil.getMessage(StringConstant.AUTO_GEN_FIELD));
    }

    public static void initReceivablePeriod(FieldAttrEntity fieldAttrEntity){
        fieldAttrEntity.setIsForbidden(0);
        fieldAttrEntity.setEditable(BasicConstant.ZERO);
        fieldAttrEntity.setEditForbidden(BasicConstant.ZERO);
        fieldAttrEntity.setShowEditable(BasicConstant.ZERO);
    }



    public static void initEstimateTime(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setDateType("yyyy-MM-dd");
        fieldAttrEntity.getDefaultAttr().setDefaultType("today");
        fieldAttrEntity.setMemo(I18nMessageUtil.getMessage(I18nStringConstant.ESTIMATE_TIME_MEMO));
       /* fieldAttrEntity.setEditable(BasicConstant.ZERO);
        fieldAttrEntity.setEditForbidden(BasicConstant.ZERO);
        fieldAttrEntity.setShowEditable(BasicConstant.ZERO);
        fieldAttrEntity.setUnableEditMemo(I18nMessageUtil.getMessage(StringConstant.AUTO_GEN_FIELD));*/
        fieldAttrEntity.setIsForbidden(0);
    }

    public static void initRealPayTime(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setDateType("yyyy-MM-dd");
    }



    /**
     * 初始化回款类型
     *
     * @param fieldAttrEntity 字段解释实体--saas专用
     * @author feng.zheng
     * @date 2019/1/17
     */
    public static void initPaymentType(FieldAttrEntity fieldAttrEntity) {
//        String str = "常规,预收款,尾款,保证金,回款支付";
        fieldAttrEntity.setItems(InitExplainsHelper.setCombItemByEnum(PaymentTypeEnum.class, fieldAttrEntity.getFieldType()));
        fieldAttrEntity.setDictionaryFlag(1);
    }

    public static void initPaymentLinkType(FieldAttrEntity fieldAttrEntity) {
//        String str = "合同,退货退款";
        fieldAttrEntity.setItems(InitExplainsHelper.setCombItemByEnum(PaymentLinkTypeEnum.class, fieldAttrEntity.getFieldType(),"attr",null));
    }

    public static void initIsRed(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setItems(InitExplainsHelper.setCombItemByEnum(IsRedEnum.class, fieldAttrEntity.getFieldType()));
    }

    public static void initHasRed(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setItems(InitExplainsHelper.setCombItemByEnum(HasRedEnum.class, fieldAttrEntity.getFieldType()));
    }

    public static void initReceivableIsRed(FieldAttrEntity fieldAttrEntity){
        fieldAttrEntity.setItems(InitExplainsHelper.setCombItemByEnum(IsRedEnum.class, fieldAttrEntity.getFieldType()));
    }

    public static void initReceivableHasRed(FieldAttrEntity fieldAttrEntity){
        fieldAttrEntity.setItems(InitExplainsHelper.setCombItemByEnum(HasRedEnum.class, fieldAttrEntity.getFieldType()));
    }

    public static void initSource(FieldAttrEntity fieldAttrEntity){
        fieldAttrEntity.setLinkedText(SOURCE_LINK_TEXT.anEnum.getAttr());
        fieldAttrEntity.setIsMultiBusiness(1);
        fieldAttrEntity.setBusinessType(XbbRefTypeEnum.PAYMENT.getCode());
        fieldAttrEntity.setIsForbidden(0);
        fieldAttrEntity.setEditable(BasicConstant.ZERO);
        fieldAttrEntity.setEditForbidden(BasicConstant.ZERO);
        fieldAttrEntity.setShowEditable(BasicConstant.ZERO);
    }
    /**
     * 初始化关联客户
     *
     * @param fieldAttrEntity 字段解释实体--saas专用
     */
    public static void initCustomer(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setLinkedType(RedundantTemplateTypeEnum.CUSTOMER.getCode());
        fieldAttrEntity.setLinkedText(CUSTOMER_LINK_TEXT.getAnEnum().getAttr());
        SaasParticularAttributePoJo saasParticularAttributePoJo = new SaasParticularAttributePoJo();
        saasParticularAttributePoJo.setMultiCheck(false);
        fieldAttrEntity.setSaasParticularAttributePoJo(saasParticularAttributePoJo);
        fieldAttrEntity.setIsForbidden(0);
    }

    /**
     * 初始化关联合同
     *
     * @param fieldAttrEntity 字段解释实体--saas专用
     */
    public static void initContract(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setLinkedType(RedundantTemplateTypeEnum.CONTRACT.getCode());
        fieldAttrEntity.setLinkedText(CONTRACT_LINK_TEXT.getAnEnum().getAttr());
        SaasParticularAttributePoJo saasParticularAttributePoJo = new SaasParticularAttributePoJo();
        saasParticularAttributePoJo.setMultiCheck(false);
        saasParticularAttributePoJo.setRelyAttr(CUSTOMER.anEnum.getAttr());
        saasParticularAttributePoJo.setRelyBusiness(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode());
        fieldAttrEntity.setSaasParticularAttributePoJo(saasParticularAttributePoJo);
        fieldAttrEntity.setIsMultiBusiness(1);
        fieldAttrEntity.setBusinessType(XbbRefTypeEnum.PAYMENT.getCode());
        fieldAttrEntity.setIsForbidden(0);
    }

    public static void initAmount(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setSummaryFlag(1);
        //初始化应收金额描述字段信息
        fieldAttrEntity.setMemo(I18nMessageUtil.getMessage(I18nStringConstant.AMOUNT_MEMO));
        fieldAttrEntity.setAmountFlag(AmountFlagEnum.YES.getType());
        fieldAttrEntity.setIsForbidden(0);
    }

    public static void initRealAmount(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setSummaryFlag(1);
        fieldAttrEntity.setAmountFlag(AmountFlagEnum.YES.getType());
        fieldAttrEntity.setUnableEditMemo(I18nMessageUtil.getMessage(StringConstant.AUTO_GEN_FIELD));
        fieldAttrEntity.setIsForbidden(0);
        fieldAttrEntity.setEditable(BasicConstant.ZERO);
        fieldAttrEntity.setEditForbidden(BasicConstant.ZERO);
        fieldAttrEntity.setShowEditable(0);
        fieldAttrEntity.setMemo(I18nMessageUtil.getMessage(I18nStringConstant.REAL_AMOUNT_MEMO));
    }

    public static void initBadAmount(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setSummaryFlag(1);
        fieldAttrEntity.setAmountFlag(AmountFlagEnum.YES.getType());
        fieldAttrEntity.setUnableEditMemo(I18nMessageUtil.getMessage(StringConstant.AUTO_GEN_FIELD));
        fieldAttrEntity.setIsForbidden(0);
        fieldAttrEntity.setEditable(BasicConstant.ZERO);
        fieldAttrEntity.setEditForbidden(BasicConstant.ZERO);
        fieldAttrEntity.setShowEditable(0);
        fieldAttrEntity.setMemo(I18nMessageUtil.getMessage(I18nStringConstant.BAD_AMOUNT_MEMO));
    }

    public static void initRedAmount(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setSummaryFlag(1);
        fieldAttrEntity.setAmountFlag(AmountFlagEnum.YES.getType());
        fieldAttrEntity.setUnableEditMemo(I18nMessageUtil.getMessage(StringConstant.AUTO_GEN_FIELD));
        fieldAttrEntity.setIsForbidden(0);
        fieldAttrEntity.setEditable(BasicConstant.ZERO);
        fieldAttrEntity.setEditForbidden(BasicConstant.ZERO);
        fieldAttrEntity.setShowEditable(0);
        fieldAttrEntity.setMemo(I18nMessageUtil.getMessage(I18nStringConstant.RED_AMOUNT_MEMO));

    }

    public static void initUnAmount(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setSummaryFlag(1);
        fieldAttrEntity.setAmountFlag(AmountFlagEnum.YES.getType());
        fieldAttrEntity.setUnableEditMemo(I18nMessageUtil.getMessage(StringConstant.AUTO_GEN_FIELD));
        fieldAttrEntity.setIsForbidden(0);
        fieldAttrEntity.setEditable(BasicConstant.ZERO);
        fieldAttrEntity.setEditForbidden(BasicConstant.ZERO);
        fieldAttrEntity.setShowEditable(0);
        fieldAttrEntity.setMemo(I18nMessageUtil.getMessage(I18nStringConstant.UN_AMOUNT_MEMO));
    }

    public static void initInvoiceAmount(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setSummaryFlag(1);
        fieldAttrEntity.setAmountFlag(AmountFlagEnum.YES.getType());
        fieldAttrEntity.setUnableEditMemo(I18nMessageUtil.getMessage(StringConstant.AUTO_GEN_FIELD));
        fieldAttrEntity.setIsForbidden(0);
        fieldAttrEntity.setEditable(BasicConstant.ZERO);
        fieldAttrEntity.setEditForbidden(BasicConstant.ZERO);
        fieldAttrEntity.setShowEditable(0);
    }

    /**
     * 负责人
     * @param fieldAttrEntity
     */
    public static void initOwnerId(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setShowType(ShowTypeEnum.ALL.getCode());
        fieldAttrEntity.setEditHide(0);
        fieldAttrEntity.setEditable(1);
        fieldAttrEntity.setMultiple(1);
        fieldAttrEntity.setIsForbidden(BasicConstant.ZERO);
        //可新增权限：默认【超级管理员、销售主管、创建人、负责人、负责人主管】可新增负责人，支持自定义；
        fieldAttrEntity.setShowEditable(0);
        fieldAttrEntity.setAdd(1);
        fieldAttrEntity.setAddAdvanceEnable(1);
        fieldAttrEntity.setShowAdd(1);
        //可删除权限：默认【超级管理员、销售主管】可删除负责人，支持自定义；
        fieldAttrEntity.setRemove(1);
        fieldAttrEntity.setRemoveAdvanceEnable(1);
        fieldAttrEntity.setShowRemove(1);
        fieldAttrEntity.setAddRule(FormDataFormExplainHelper.getDefaultRule(RoleEnum.MANAGER));
        fieldAttrEntity.setRemoveRule(FormDataFormExplainHelper.getDefaultRule(RoleEnum.MANAGER));
    }

    /**
     * 协同人
     * @param fieldAttrEntity
     */
    public static void initCoUserId(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setShowType(ShowTypeEnum.ALL.getCode());
        fieldAttrEntity.setEditHide(0);
        fieldAttrEntity.setEditable(1);
        fieldAttrEntity.setFormPermission(BasicConstant.ONE);
        fieldAttrEntity.setIsForbidden(BasicConstant.ZERO);
        //下面是一些高级属性
        //可新增权限，默认【超级管理员、销售主管、创建人、负责人、负责人主管】可新增负责人，支持自定义；
        fieldAttrEntity.setShowEditable(0);
        fieldAttrEntity.setAdd(1);
        fieldAttrEntity.setAddAdvanceEnable(1);
        fieldAttrEntity.setShowAdd(1);
        //可删除权限
        fieldAttrEntity.setRemove(1);
        fieldAttrEntity.setRemoveAdvanceEnable(1);
        fieldAttrEntity.setShowRemove(1);
        fieldAttrEntity.setAddRule(FormDataFormExplainHelper.getDefaultRule(RoleEnum.MANAGER));
        fieldAttrEntity.setRemoveRule(FormDataFormExplainHelper.getDefaultRule(RoleEnum.MANAGER));
    }

    public static void initCreatorId(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setEditable(0);
        fieldAttrEntity.setUnableEditMemo(I18nMessageUtil.getMessage(StringConstant.AUTO_GEN_FIELD));
    }
    public static void initAddTime(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setEditable(0);
        fieldAttrEntity.setUnableEditMemo(I18nMessageUtil.getMessage(StringConstant.AUTO_GEN_FIELD));
    }
    public static void initUpdateTime(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setEditable(0);
        fieldAttrEntity.setUnableEditMemo(I18nMessageUtil.getMessage(StringConstant.AUTO_GEN_FIELD));
    }

    public static void initSourceRefType(FieldAttrEntity fieldAttrEntity) {
        //关联单据业务类型，可能是回款计划、或销项发票
        fieldAttrEntity.setIsMultiBusiness(1);
        fieldAttrEntity.setBusinessType(XbbRefTypeEnum.PAYMENT.getCode());
    }

    public static void initReceivablesOriginId(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setLinkedType(XbbRefTypeEnum.PAYMENT.getCode());
        fieldAttrEntity.setLinkedText(RECEIVABLES_ORIGIN_LINK_TEXT.getAnEnum().getAttr());
        fieldAttrEntity.setBusinessType(XbbRefTypeEnum.PAYMENT.getCode());
        fieldAttrEntity.setEditForbidden(BasicConstant.ZERO);
    }
}
